Global Index
HTML5 JS API Index > Web Sockets and Messaging Tutorials & Specs

MessageEvent

Extends Event.

Properties
any
data
The data attribute must return the value it was initialized to. When the object is created, this attribute must be initialized to null. It represents the message being sent.
DOMString
lastEventId
The lastEventId attribute must return the value it was initialized to. When the object is created, this attribute must be initialized to the empty string. It represents, in server-sent events, the last event ID string of the event source.
DOMString
origin
The origin attribute must return the value it was initialized to. When the object is created, this attribute must be initialized to the empty string. It represents, in server-sent events and cross-document messaging, the origin of the document that sent the message (typically the scheme, hostname, and port of the document, but not its path or fragment identifier).
MessagePort[]?
ports
The ports attribute must return the value it was initialized to. When the object is created, this attribute must be initialized to null. It represents, in cross-document messaging and channel messaging, the MessagePort array being sent, if any.
(WindowProxy or MessagePort)
source
The source attribute must return the value it was initialized to. When the object is created, this attribute must be initialized to null. It represents, in cross-document messaging, the WindowProxy of the browsing context of the Window object from which the message came; and in the connect events used by shared workers, the newly connecting MessagePort.
Constructor
MessageEvent(DOMString type, optional MessageEventInit eventInitDict)